<?php
/**
 * aheadWorks Co.
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the EULA
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/AW-LICENSE.txt
 *
 * =================================================================
 *                 MAGENTO EDITION USAGE NOTICE
 * =================================================================
 * This package designed for Magento community edition
 * aheadWorks does not guarantee correct work of this extension
 * on any other Magento edition except Magento community edition.
 * aheadWorks does not provide extension support in case of
 * incorrect edition usage.
 * =================================================================
 *
 * @category   AW
 * @package    AW_Blog
 * @version    1.2.1
 * @copyright  Copyright (c) 2010-2012 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/AW-LICENSE.txt
 */
?> <?php $posts = $this->getPosts(); ?>

<?php if (count($posts)): ?>
 <?php ?>
	<ol id="blog-list" class="products-list">
    <?php foreach ($posts as $post): ?>
        <li class="postWrapper item">
			<div class="item-inner">
				<!--
				<div class="product-image">
					<a title="<?php echo substr($post->getTitle(),0,25);?>" href="<?php echo $post->getAddress(); ?>">
						<img alt="<?php echo substr($post->getTitle(),0,25);?>" src="<?php echo  Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA).$post->getPostImage();?>"> 
					</a>
				</div>
				-->
				<div class="product-info">
					<div class="product-name">
						<h2><a class="title-blog-name" href="<?php echo $post->getAddress(); ?>" ><?php echo $post->getTitle(); ?></a></h2>
						<!--<h3><?php echo $post->getCreatedTime(); ?></h3>-->
					</div>
					<div class="info-cat-blog">
						<?php echo $post->getCreatedTime();?>
					</div>
					<div class="postContent"><?php echo $post->getPostContent(); ?>
						<div class="bottom-info-blog">
							<ul class="list-info-bottom">
								<li>
									<?php if ($this->getCommentsEnabled()): ?>
										<a class="link-comment" href="<?php echo $post->getAddress(); ?>#commentBox" ><?php echo $post->getCommentCount(); ?> <?php if($post->getCommentCount()<=1) echo $this->__('Comment'); ?>  <?php if($post->getCommentCount()>1) echo $this->__('Comments'); ?></a>
									<?php endif; ?>
								</li>
								<li>&nbsp;|&nbsp;</li>
								<li>
									<?php echo $this->__("Posted By:"); ?> <span class="user-wr"><?php echo $post->getUser(); ?></span>
								</li>
							</ul>
						</div>
					</div>
					
					<!--
					<?php echo $this->getBookmarkHtml($post) ?>
					<div class="tags"><?php echo Mage::getBlockSingleton('blog/blog')->getTagsHtml($post) ?></div>
					<div class="postDetails">
						<?php if ($this->getCommentsEnabled()): ?>
							<?php echo $post->getCommentCount(); ?> <a href="<?php echo $post->getAddress(); ?>#commentBox" >Comments</a> | 
						<?php endif; ?>
						<?php $postCats = $post->getCats(); ?>
						<?php if (!empty($postCats)): ?>
							<?php echo Mage::helper('blog')->__('Posted in'); ?>
							<?php foreach ($postCats as $data): ?>               
									<a href="<?php echo $data['url']; ?>"><?php echo $data['title']; ?></a> 
							<?php endforeach; ?> 
						<?php else: ?>
							<?php echo Mage::helper('blog')->__('Posted'); ?>
						<?php endif; ?><?php echo$this->__("By"); ?> <?php echo $post->getUser(); ?>
					</div>
					-->
				</div>
			</div>
        </li>
    <?php endforeach; ?>
	</ol>
	<div class="toolbar-cat">
 <?php echo $this->getChildHtml('aw_blog_comments_toolbar'); ?>
 </div>
<?php else: ?>  
    <?php echo Mage::helper('blog')->__('No Posts in this Category.'); ?>
<?php endif; ?>
